const express = require('express');
const { static } = require('express');
// const bodyParser = require('body-parser');

const app = express();
app.set('secret', 'gg45yg4')

//跨域
app.use(require('cors')());
app.use(express.json());

// app.use(bodyParser.urlencoded({ extended: false }));

//托管静态文件
app.use('/uploads', express.static(__dirname + '/uploads'));

require('./plugins/db')(app);
// const admin = require('./routes/admin');
// app.use('/admin', admin);


require('./routes/adminCRUD')(app);

app.listen(3000, ()=> {
  console.log('http://localhost:3000');
})
